package com.game.euchre.Tests;

import static org.junit.Assert.*;

import org.junit.Test;

import com.game.euchre.Card;
import com.game.euchre.Dealer;

public class DealerTest {
	
	@Test
	public void initializationTest() {
		Dealer test = new Dealer();
		assertNotNull("Error Dealer object not initialized",test);
	}
	
	@Test
	public void testGetTotalCards() {
		Dealer test = new Dealer();
		assertEquals("Error in getTotalCards()",24,test.getTotalCards());
	}

	
	// To test the rest you need to comment out the Shuffle method inside of Dealer.java inside of the Dealer() method at the bottom.
	@Test
	public void testDrawFromDeck() {
		Dealer test = new Dealer();
		String card = "9 of h";
		assertEquals("Error in drawFromDeck()",card,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer1() {
		Dealer test = new Dealer();
		String one = "9 of h";
		assertEquals("Error in first card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer2() {
		Dealer test = new Dealer();
		String one = "10 of h";
		for(int i = 0; i < 1; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in second card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer3() {
		Dealer test = new Dealer();
		String one = "Jack of h";
		for(int i = 0; i < 2; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in third card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer4() {
		Dealer test = new Dealer();
		String one = "Queen of h";
		for(int i = 0; i < 3; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in fourth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer5() {
		Dealer test = new Dealer();
		String one = "King of h";
		for(int i = 0; i < 4; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in fifth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer6() {
		Dealer test = new Dealer();
		String one = "Ace of h";
		for(int i = 0; i < 5; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in sixth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer7() {
		Dealer test = new Dealer();
		String one = "9 of d";
		for(int i = 0; i < 6; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in seventh card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer8() {
		Dealer test = new Dealer();
		String one = "10 of d";
		for(int i = 0; i < 7; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in eigth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer9() {
		Dealer test = new Dealer();
		String one = "Jack of d";
		for(int i = 0; i < 8; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in ninth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer10() {
		Dealer test = new Dealer();
		String one = "Queen of d";
		for(int i = 0; i < 9; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in tenth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer11() {
		Dealer test = new Dealer();
		String one = "King of d";
		for(int i = 0; i < 10; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in eleventh card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer12() {
		Dealer test = new Dealer();
		String one = "Ace of d";
		for(int i = 0; i < 11; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in twelveth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer13() {
		Dealer test = new Dealer();
		String one = "9 of s";
		for(int i = 0; i < 12; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in thirteenth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer14() {
		Dealer test = new Dealer();
		String one = "10 of s";
		for(int i = 0; i < 13; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in fourteenth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer15() {
		Dealer test = new Dealer();
		String one = "Jack of s";
		for(int i = 0; i < 14; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in fifteenth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer16() {
		Dealer test = new Dealer();
		String one = "Queen of s";
		for(int i = 0; i < 15; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in sixteenth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer17() {
		Dealer test = new Dealer();
		String one = "King of s";
		for(int i = 0; i < 16; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in seventeenth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer18() {
		Dealer test = new Dealer();
		String one = "Ace of s";
		for(int i = 0; i < 17; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in eighteenth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer19() {
		Dealer test = new Dealer();
		String one = "9 of c";
		for(int i = 0; i < 18; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in nineteenth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer20() {
		Dealer test = new Dealer();
		String one = "10 of c";
		for(int i = 0; i < 19; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in twentyth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer21() {
		Dealer test = new Dealer();
		String one = "Jack of c";
		for(int i = 0; i < 20; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in twenty-first card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer22() {
		Dealer test = new Dealer();
		String one = "Queen of c";
		for(int i = 0; i < 21; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in twenty-second card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer23() {
		Dealer test = new Dealer();
		String one = "King of c";
		for(int i = 0; i < 22; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in twenty-third card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testDealer24() {
		Dealer test = new Dealer();
		String one = "Ace of c";
		for(int i = 0; i < 23; i++) {
			test.drawFromDeck();
		}
		assertEquals("Error in twenty-fourth card of deck",one,test.drawFromDeck().toString());
	}
	
	@Test
	public void testHand1() {
		Card[] hand = new Dealer().hand();
		String card1 = hand[0].toString();
		String test1 = new Card(0,0,0,0).toString(); 
		assertEquals("Error in hand()",test1,card1);
	}
	
	@Test
	public void testHand2() {
		Card[] hand = new Dealer().hand();
		String card2 = hand[1].toString();
		String test2 = new Card(0,1,0,1).toString();
		assertEquals("Error in hand()",test2,card2);
	}
	
	@Test
	public void testHand3() {
		Card[] hand = new Dealer().hand();
		String card3 = hand[2].toString();
		String test3 = new Card(0,2,0,2).toString();
		assertEquals("Error in hand()",test3,card3);
	}
	
	@Test
	public void testHand4() {
		Card[] hand = new Dealer().hand();
		String card4 = hand[3].toString();
		String test4 = new Card(0,3,0,3).toString();
		assertEquals("Error in hand()",test4,card4);
	}
	
	@Test
	public void testHand5() {
		Card[] hand = new Dealer().hand();
		String card5 = hand[4].toString();
		String test5 = new Card(0,4,0,4).toString();
		assertEquals("Error in hand()",test5,card5);
	}
	
	@Test
	public void testKitty1() {
		Card[] hand = new Dealer().kitty();
		String card1 = hand[0].toString();
		String test1 = new Card(0,0,0,0).toString();
		assertEquals("Error in kitty()",test1,card1);
	}
	
	@Test
	public void testKitty2() {
		Card[] hand = new Dealer().kitty();
		String card2 = hand[1].toString();
		String test2 = new Card(0,1,0,1).toString();
		assertEquals("Error in kitty()",test2,card2);
	}
	
	@Test
	public void testKitty3() {
		Card[] hand = new Dealer().kitty();
		String card3 = hand[2].toString();
		String test3 = new Card(0,2,0,2).toString();
		assertEquals("Error in kitty()",test3,card3);
	}
	
	@Test
	public void testKitty4() {
		Card[] hand = new Dealer().kitty();
		String card4 = hand[3].toString();
		String test4 = new Card(0,3,0,3).toString();
		assertEquals("Error in kitty()",test4,card4);
	}
	
	
}
